// AriaVG.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "AriaVG.h"
#include "A2DDevice.h"
#include "A2DImage.h"

LRESULT CALLBACK MyWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg)
	{
	case WM_CREATE:
		return 0;
	default:
		return DefWindowProcW(hwnd, uMsg, wParam, lParam);
	}
}

int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
{		
	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
	
	WNDCLASSEXW wcx;
	ZeroMemory(&wcx, sizeof(wcx));
	wcx.cbSize = sizeof(wcx);
	wcx.style = CS_DBLCLKS;
	wcx.lpfnWndProc = MyWindowProc;
	wcx.hInstance = hInstance;
	wcx.lpszClassName = L"MyWindow";
	RegisterClassExW(&wcx);

	HWND window = CreateWindowW(L"MyWindow", L"AriaVG", WS_OVERLAPPEDWINDOW, 0, 0, 1, 1, nullptr, nullptr, hInstance, nullptr);

	A2DDevice device;
	device.Create(window, true, CSize(800, 600), 0);
	boost::shared_ptr<A2DImage> image(A2DImage::Create(device));
	image->LoadFromFile(L"D:\\Capture.jpg");

	DestroyWindow(window);
	return 0;
}
